let privacyHandler
let privacyResolves = new Set()
let closeOtherPagePopUpHooks = new Set()
Component({
  data: {
    title: "用户隐私保护提示",
    desc1: "感谢您的使用，使用该功能前请先阅读并同意:",
    urlTitle: "《用户隐私保护指引》",
    desc2: "当您点击同意并开始时用产品服务时，即表示你已理解并同息该条款内容，该条款将对您产生法律约束力。如您拒绝，将无法正常使用该功能。",
    height: 0,
    check:true
  },
  properties: {
    'innerShow':{
      type:Boolean,
      value:false
    }
  },
  methods: {
    handleAgree(e) {
      const app = getApp()
      this.setData({
        innerShow:false
      })
      privacyResolves.forEach(resolve => {
        resolve({
          event: 'agree',
          buttonId: 'agree-btn'
        })
      })
      this.triggerEvent('changePrivacySetting', false)
      app.needPrivacySetting()
      privacyResolves.clear()
    },
    handleDisagree(e) {
      this.setData({
        innerShow:false
      })
      privacyResolves.forEach(resolve => {
        resolve({
          event: 'disagree',
        })
      })
      privacyResolves.clear()
    },
    openPrivacyContract() {
      wx.openPrivacyContract({
        success: res => {
          console.log('openPrivacyContract success')
        },
        fail: res => {
          console.error('openPrivacyContract fail', res)
        }
      })
    }
  }
})